import { defineStore } from "pinia"
import { reactive, computed } from "vue"
import { UserType } from "@/types/response/user"

export const useUserStore = defineStore('user', () => {
  const state: {
    UserInfo: UserType
  } = reactive({
    UserInfo: <UserType>{}
  })

  const getUserInfo = computed(() => {
    return state.UserInfo
  })

  function setUserInfo(info: UserType) {
    state.UserInfo = info
  }

  return { getUserInfo, setUserInfo }
})